package com.qf.fc.controller;



import com.qf.fc.Param.MoodAdd;
import com.qf.fc.dto.MoodDetail;
import com.qf.fc.entity.User;
import com.qf.fc.service.MoodService;
import com.qf.fc.vo.R;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 动态表(Mood)表控制层
 *
 * @author makejava
 * @since 2024-09-23 23:34:47
 */
@RestController
@RequestMapping("/api/mood/")
@Tag(name = "动态接口") //knife4j 接口文档
public class MoodController {
    /**
     * 服务对象
     */
    @Resource
    private MoodService service;


    @PostMapping("add")
    public R addMood(@RequestBody MoodAdd add){
        return service.add(add);
    }


    @GetMapping("my")
    public R<MoodDetail> myMoods(Integer uid){
        return service.queryMy(uid);
    }
    @GetMapping("page")
    public R moodsPage(String type,Integer page,Integer size){
        return service.queryPage(type,page,size);
    }
    @GetMapping("detail")
    public R detail(Integer id){
        return service.queryDetail(id);
    }
    @GetMapping("{uid}")
    public R<User> user(@PathVariable String uid){
        return service.queryById(uid);
    }
}

